//
// Created by xujingyi on 2021/5/16.
//

#ifndef ALLIANCE_SENTRY_V2_0_SOLVE_PNP_H
#define ALLIANCE_SENTRY_V2_0_SOLVE_PNP_H

#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/calib3d/calib3d.hpp>
#include <iostream>
#include <options.h>
#include "find/armor_class.h"

//using namespace std;
//using namespace cv;
namespace rm{
class SolvePNP
{
public:
    SolvePNP();
    ~SolvePNP()=default;

    //获得旋转矩形角点并保存在PNP_box_point2fs
//    virtual bool operator()(rm::Armor &armor_box, const cv::Point2f offset, cv::Mat &img2show);
    virtual bool operator()(rm::MarkerCouple &couple, const cv::Point2f offset, cv::Mat &img2show);
    virtual void clear();

    void drawCSYS(cv::Mat img) const;
private:
    cv::Mat_<TYPE_POS> _cameraMatrix;
    cv::Mat_<TYPE_POS> _distortionCoefficients;
    cv::Mat_<TYPE_POS> _rvecs;
    cv::Mat_<TYPE_POS> _tvecs;
    std::vector<cv::Point2f> _PNP_box_point2fs;//图像里的box
    std::vector<cv::Point3f> _refer_point3fs;
    cv::Point2f _coef=cv::Point2f((1280-PICTURE_COL_NUM)/2,(1024-PICTURE_ROW_NUM)/2);
//    cv::Point2f _coef=cv::Point2f((0)/2,(0)/2);
};
};

#endif //ALLIANCE_SENTRY_V2_0_SOLVE_PNP_H
